package com.example.demo.task;

import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobKey;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
@Slf4j
public class DynamicTask extends QuartzJobBean {


    @Override
    protected void executeInternal(JobExecutionContext context) {
        // 根据key。到数据库取任务类型，取到sql，做对应的业务操作。
        JobKey key = context.getJobDetail().getKey();
        System.out.println("开始任务------》"+key.toString());
    }
}
